import com.deepoove.poi.XWPFTemplate;

import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashMap;

public class TemplateUtils {

    public static void main(String[] args) throws IOException {

        String input = "D:\\Work\\work_space\\ruoyivue1\\gao-xin-admin\\gx-template\\src\\main\\resources\\template.docx";

        XWPFTemplate template = XWPFTemplate.compile(input).render(
                new HashMap<String, Object>(){{
                    put("title", "Hi, poi-tl Word模板引擎");
                }});
        template.writeAndClose(new FileOutputStream("output.docx"));
    }
}
